<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">


<head>

    <meta charset="utf-8"/>

    <title>编辑角色</title>

    <meta content="width=device-width, initial-scale=1.0" name="viewport"/>

    <meta content="" name="description"/>

    <meta content="sss" name="author"
          th:content="${#httpServletRequest.getRequestURI()}"/>

    <!-- BEGIN GLOBAL MANDATORY STYLES -->

    <link href="/media/css/bootstrap.min.css" rel="stylesheet"
          type="text/css"/>

    <link href="/media/css/bootstrap-responsive.min.css" rel="stylesheet"
          type="text/css"/>

    <link href="/media/css/font-awesome.min.css" rel="stylesheet"
          type="text/css"/>

    <link href="/media/css/style-metro.css" rel="stylesheet" type="text/css"/>

    <link href="/media/css/style.css" rel="stylesheet" type="text/css"/>

    <link href="/media/css/style-responsive.css" rel="stylesheet"
          type="text/css"/>
    <!-- END GLOBAL MANDATORY STYLES -->

    <!-- BEGIN PAGE LEVEL STYLES -->

    <link rel="stylesheet" type="text/css"
          href="/media/css/select2_metro.css"/>

    <link rel="stylesheet" href="/media/css/DT_bootstrap.css"/>

    <!-- END PAGE LEVEL STYLES -->

    <link rel="shortcut icon" href="/media/image/favicon.ico"/>

    <link rel="stylesheet"
          href="/media/ztree/css/bootstrapStyle/bootstrapStyle.css"
          type="text/css">

</head>
<!-- END HEAD -->

<!-- BEGIN BODY -->

<body>
<div class="row-fluid">
    <div class="span12">
        <div class="portlet">
            <div class="portlet-body form">

                <form action="#" method="POST" class="form-horizontal"
                      id="edit_role_form">
                    <div class="form-wizard">
                        <div class="control-group">
                            <label class="control-label">角色名<span class="required">*</span></label>

                            <div class="controls">
                                <input type="text" class="span6 m-wrap" name="roleName" th:value="${role.roleName}"/>
                                <span
                                        class="help-inline"></span>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">角色码<span class="required">*</span></label>
                            <div class="controls">
                                <input type="text" class="span6 m-wrap" name="roleCode" th:value="${role.roleCode}"/>
                                <span
                                        class="help-inline"></span>
                            </div>
                        </div>
                        <div class="control-group ">
                            <label class="control-label">角色描述</label>
                            <div class="controls">
                                <textarea class="span6 m-wrap" name="roleDesc" th:text="${role.roleDesc}"></textarea>
                                <span class="help-inline"></span>
                            </div>
                        </div>
                        <div class="control-group" sec:authorize="hasAuthority('PERMISSION_GARDEN')">
                            <label class="control-label">所属幼儿园</label>
                            <div class="controls">
                                <select class="m-wrap span6"
                                        name="gardenId">
                                    <option value="1" th:each="garden:${gardens}" th:text="${garden.gardenName}"
                                            th:value="${garden.id}" th:selected="${garden.id} eq ${role.gardenId}">男
                                    </option>
                                </select>
                                <span class="help-inline"></span>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">角色授权</label>
                            <div class="controls">
                                <ul id="treeEdit" class="ztree"></ul>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script src="/media/js/jquery-1.10.1.min.js" type="text/javascript"></script>
<script src="/media/js/jquery-migrate-1.2.1.min.js"
        type="text/javascript"></script>
<script src="/media/js/jquery-ui-1.10.1.custom.min.js"
        type="text/javascript"></script>
<script src="/media/js/bootstrap.min.js" type="text/javascript"></script>

<script type="text/javascript" src="/media/js/select2.min.js"></script>

<script type="text/javascript" src="/media/js/jquery.dataTables.min.js"></script>

<script type="text/javascript" src="/media/js/DT_bootstrap.js"></script>

<!-- END PAGE LEVEL PLUGINS -->

<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script type="text/javascript"
        src="/media/ztree/js/jquery.ztree.core.js"></script>
<script type="text/javascript"
        src="/media/ztree/js/jquery.ztree.excheck.js"></script>
<script src="/media/js/app.js"></script>

<script th:inline="javascript">

    jQuery(document).ready(function () {

        App.init();
        var data = [[${treeData}]];

        $.fn.zTree.init($("#treeEdit"), {
            view: {
                showIcon: false
            },
            check: {
                enable: true
                //,chkboxType: { "Y": "p", "Y": "s" }
            },
            data: {
                simpleData: {
                    enable: true
                }
            }
        }, data);


    });
    //这个是留给layer所在的父页面调用的
    function getTree() {
        var zTreeObj = $.fn.zTree.getZTreeObj("treeEdit");
        return zTreeObj;
    }

</script>

<script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-37564768-1']);
    _gaq.push(['_setDomainName', 'keenthemes.com']);
    _gaq.push(['_setAllowLinker', true]);
    _gaq.push(['_trackPageview']);
    (function () {
        var ga = document.createElement('script');
        ga.type = 'text/javascript';
        ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://'
                : 'http://')
            + 'stats.g.doubleclick.net/dc.js';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(ga, s);
    })();
</script>
</body>

<!-- END BODY -->

</html>